/*
 * Copyright:  2018 smarabbit studio.
 *
 *  Licensed under the Confluent Community License; you may not use this file
 *  except in compliance with the License.  You may obtain a copy of the License at
 *
 *  http://www.confluent.io/confluent-community-license
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 *  WARRANTIES OF ANY KIND, either express or implied.  See the License for the
 *  specific language governing permissions and limitations under the License.
 *
 *  @作   者： 黄开晖 (117227773@qq.com)
 *  @日   期:  2020年9月3日
 */
package com.massyframework.beanskin.service.adapt;

/**
 *  适配对象工厂
 *  
 *  <p>
 *  {@code AdaptObjectFactory}, 提供{@link #createAdaptObject(Object, Class)}方法用于创建适配的对象
 */
public interface AdaptObjectFactory<A>{
	
	/**
	 * 宿主类型
	 * @return {@link Class}
	 */
	Class<?> getHostType(); 
	
	/**
	 * 支持的适配对象
	 * @return {@link Class}
	 */
	Class<A> supportAdaptObject();

    /**
     * 创建可适配对象,如果不支持对{@code host}适配{@link A},则返回null.
     * @param host {@link H}, 需要适配的宿主
     * @return {@link A}, 不支持适配返回null.
     */
    A createAdaptObject(Object host, Class<A> adaptType);
}
